<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	session.setAttribute("basePath", basePath);
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<script type="text/javascript" src="${basePath }js/jquery-2.1.4.js"></script>
<script type="text/javascript" src="${basePath }js/bootstrap.min.js"></script>
<link rel="stylesheet" href="${basePath }css/bootstrap.min.css">
</head>
<body>
<script type="text/javascript">
	function check(){
		var flag = true;
		var admin = document.getElementById("userId").value;
		var password = document.getElementById("userPassword").value;
		if ("" == admin){
			alert("请输入账号！");
			flag = false;
			return false;
		}
		else if ("" == password){
			alert("请输入密码！");
			flag = false;
			return false;
		}
		if(flag == true){
			//form.submit();
			return true;
		}
	}
</script>
<div class="container" style="margin-top: 200px">
		<div class="row">
			<div class="col-md-4"></div>
			<div class="col-md-4">
				<h3 class="text-center">用户登录</h3>
				<form class="form-horizontal" action="${basePath }user/dologin.do" method="post">
					<div class="form-group">
					<label for="userId" class="col-sm-2 control-label">账号</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="userId"
								name="userId" placeholder="请输入账号">
						</div>
					</div>
					<div class="form-group">
					<label for="userPassword" class="col-sm-2 control-label">密码</label>
						<div class="col-sm-10">
							<input type="password" class="form-control" id="userPassword"
								name="userPassword" placeholder="请输入密码">
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" class="btn btn-block btn-primary" onclick="return check();">登录</button>
						</div>
					</div>
				</form>
			</div>
			<div class="col-md-4"></div>
		</div>
	</div>
</body>
</html>